{include file="public/head"}
<body style="background:#eee">

<header class="aui-header-default aui-header-fixed aui-header-bg">
    <a href="javascript:history.back(-1)" class="aui-header-item">
        <i class="aui-icon aui-icon-back-white"></i>
    </a>
    <div class="aui-header-center aui-header-center-clear">
        <div class="aui-header-center-logo">
            <div class="aui-car-white-Typeface" style="color:black;font-weight: bold;">密码修改</div>
        </div>
    </div>
    <a href="#" class="aui-header-item-icon"   style="min-width:0">
        <!--<i class="aui-icon aui-icon-search"></i>-->
    </a>
</header>


<section class="aui-myOrder-content">
    <div class="aui-prompt"><i class="aui-icon aui-prompt-sm"></i>支付密码修改(初始密码123456)</div>
    <div class="aui-Address-box">
        <p>
            <input class="aui-Address-box-input" type="password" placeholder="请输入原密码" id="old_password">
        </p>
        <p>
            <input class="aui-Address-box-input" type="password" placeholder="请输入新密码" id="new_password" >
        </p>
        <p>
            <input class="aui-Address-box-input" type="password" placeholder="再次输入新密码" id="sure_password">
        </p>
    </div>
    <div class="aui-out">
        <a href="javascript:" class="red-color" style="color:#fff" id="save">立即修改</a>
    </div>
</section>


<script type="text/javascript" src="__STATIC__/User/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/User/js/aui.js"></script>
<script type="text/javascript" >
    $(function(){
        //保存信息
        $('#save').on('click',function () {
            var old_password = $('#old_password').val();
            var new_password = $('#new_password').val();
            var sure_password = $('#sure_password').val();

            if (old_password == ''){
                alert('请输入原密码');
                return false;
            }
            if (new_password == ''){
                alert('请输入新密码');
                return false;
            }
            if (sure_password == ''){
                alert('请再次输入新密码');
                return false;
            }

            if(new_password != sure_password){
                alert('两次密码不一致');
                return false;
            }

            $.ajax({
                type: "post",
                url: "{:url('User/UserPassPay')}",
                data: {
                    old_password: old_password,
                    new_password: new_password,
                },
                dataType: "json",
                success: function (data) {
                    if(data.status == 1){
                        alert(data.message);
                        window.location.reload();
                    }else{
                        alert(data.message);
                    }
                }
            });

        })
    })
</script>
</body>
</html>